﻿@model NK.Mvc3.Models.StoreOutput
@{
    ViewBag.Title = "Output Import";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Output Import</h2>


@using (Html.BeginForm("Import", "StoreOutput", FormMethod.Post, new { @encType = "multipart/form-data" }))
{
     <fieldset>
        <legend>Output Import</legend>
        <div class="editor-label">
            File Import
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DateOutput)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DateOutput)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FromDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FromDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ToDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ToDate)
        </div>

        <div class="editor-field">
            <input type="file" name="file" id="file" />
            @Html.ValidationMessage("file")
        </div>

        <input type="submit" name="submit" text="upload" />
    </fieldset>

}


@if (Model != null && Model.StoreOutputDetails != null && Model.StoreOutputDetails.Count > 0)
{
    <table>
    <tr>
        <th>
            Barcode
        </th>
        <th>
            POS Description
        </th>
        <th>
            Quantity
        </th>
        <th>
            CostOutput
        </th>
        <th>
            TotalCost
        </th>
        <th></th>
    </tr>
    @foreach (var item in Model.StoreOutputDetails)
     {
        <tr>
        <td>
            @Html.DisplayFor(modelItem => item.ProductInfo.BarCode)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ProductInfo.POSDescription)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Quantity)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CostOutput)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TotalCost)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", "StoreOutputDetail", new { id = item.ID }) |
            @Html.ActionLink("Details", "Details", "StoreOutputDetail", new { id = item.ID }) |
            @Html.ActionLink("Delete", "Delete", "StoreOutputDetail", new { id = item.ID })
        </td>
    </tr>
    }

    </table>
    
}


